import static org.junit.Assert.*;

import org.junit.Test;


public class WinnerTest {
	
	@Test
	public void testPoker() {
		Winner a = new Winner();
		HandDeck x = new HandDeck();
		x.handDeck.add(new Card(10,0));
		x.handDeck.add(new Card(11,0));
		x.handDeck.add(new Card(12,0));
		x.handDeck.add(new Card(13,0));
		x.handDeck.add(new Card(14,0));
		
		a.Scheme(x);
		
		assertEquals(1,x.scheme);
		
	}
	
	@Test
	public void testFlush() {
		Winner a = new Winner();
		HandDeck x = new HandDeck();
		x.handDeck.add(new Card(5,0));
		x.handDeck.add(new Card(11,0));
		x.handDeck.add(new Card(6,0));
		x.handDeck.add(new Card(3,0));
		x.handDeck.add(new Card(2,0));
		
		x.Sorting();
		
		a.Scheme(x);
		
		assertEquals(4,x.scheme);
		
	}
	
	@Test
	public void testThreeOfaKind() {
		Winner a = new Winner();
		HandDeck x = new HandDeck();
		x.handDeck.add(new Card(10,0));
		x.handDeck.add(new Card(10,1));
		x.handDeck.add(new Card(10,2));
		x.handDeck.add(new Card(13,0));
		x.handDeck.add(new Card(14,0));
		
		x.Sorting();
		
		a.Scheme(x);
		
		assertEquals(6,x.scheme);
		
	}
	
	@Test
	public void testTwoPair() {
		Winner a = new Winner();
		HandDeck x = new HandDeck();
		x.handDeck.add(new Card(10,0));
		x.handDeck.add(new Card(10,1));
		x.handDeck.add(new Card(12,0));
		x.handDeck.add(new Card(13,0));
		x.handDeck.add(new Card(12,4));
		
		x.Sorting();
		
		a.Scheme(x);
		
		assertEquals(7,x.scheme);
		
	}
	
	@Test
	public void testFourOfaKind() {
		Winner a = new Winner();
		HandDeck x = new HandDeck();
		x.handDeck.add(new Card(10,0));
		x.handDeck.add(new Card(10,1));
		x.handDeck.add(new Card(10,2));
		x.handDeck.add(new Card(10,3));
		x.handDeck.add(new Card(12,4));
		
		x.Sorting();
		
		a.Scheme(x);
		
		assertEquals(2,x.scheme);
		
	}
	
	@Test
	public void testFull() {
		Winner a = new Winner();
		HandDeck x = new HandDeck();
		x.handDeck.add(new Card(10,0));
		x.handDeck.add(new Card(10,1));
		x.handDeck.add(new Card(12,0));
		x.handDeck.add(new Card(12,1));
		x.handDeck.add(new Card(10,3));
		
		x.Sorting();
		
		a.Scheme(x);
		
		assertEquals(3,x.scheme);
	}
	
	@Test
	public void testPair() {
		Winner a = new Winner();
		HandDeck x = new HandDeck();
		x.handDeck.add(new Card(10,0));
		x.handDeck.add(new Card(10,1));
		x.handDeck.add(new Card(12,0));
		x.handDeck.add(new Card(13,0));
		x.handDeck.add(new Card(14,4));
		
		x.Sorting();
		
		a.Scheme(x);
		
		assertEquals(8,x.scheme);
	}	
	
	@Test
	public void testHighCard() {
		Winner a = new Winner();
		HandDeck x = new HandDeck();
		x.handDeck.add(new Card(8,0));
		x.handDeck.add(new Card(10,1));
		x.handDeck.add(new Card(12,0));
		x.handDeck.add(new Card(13,0));
		x.handDeck.add(new Card(14,3));
		
		x.Sorting();
		
		a.Scheme(x);
		
		assertEquals(9,x.scheme);
	}
	
	@Test
	public void testStraight() {
		Winner a = new Winner();
		HandDeck x = new HandDeck();
		x.handDeck.add(new Card(2,0));
		x.handDeck.add(new Card(3,0));
		x.handDeck.add(new Card(4,0));
		x.handDeck.add(new Card(5,0));
		x.handDeck.add(new Card(6,3));
		
		x.Sorting();
		
		a.Straight(x);
		
		assertEquals(5,x.scheme);
	}

	@Test
	public void testStraight2() {
		Winner a = new Winner();
		HandDeck x = new HandDeck();
		x.handDeck.add(new Card(2,0));
		x.handDeck.add(new Card(3,0));
		x.handDeck.add(new Card(4,0));
		x.handDeck.add(new Card(5,0));
		x.handDeck.add(new Card(6,3));
		
		x.Sorting();
		
		a.Scheme(x);
		
		assertEquals(5,x.scheme);
	}
}
